<!DOCTYPE html>
<html>
	<head>
		<meta name="layout" content="main"/>
		<title>Welcome to Pijunn</title>
		<style type="text/css" media="screen">
			#status {
				background-color: #eee;
				border: .2em solid #fff;
				margin: 2em 2em 1em;
				padding: 1em;
				width: 12em;
				float: left;
				-moz-box-shadow: 0px 0px 1.25em #ccc;
				-webkit-box-shadow: 0px 0px 1.25em #ccc;
				box-shadow: 0px 0px 1.25em #ccc;
				-moz-border-radius: 0.6em;
				-webkit-border-radius: 0.6em;
				border-radius: 0.6em;
			}

			.ie6 #status {
				display: inline; /* float double margin fix http://www.positioniseverything.net/explorer/doubled-margin.html */
			}

			#status ul {
				font-size: 0.9em;
				list-style-type: none;
				margin-bottom: 0.6em;
				padding: 0;
			}
            
			#status li {
				line-height: 1.3;
			}

			#status h1 {
				text-transform: uppercase;
				font-size: 1.1em;
				margin: 0 0 0.3em;
			}

			#page-body {
				margin: 2em 1em 1.25em 18em;
			}

			h2 {
				margin-top: 1em;
				margin-bottom: 0.3em;
				font-size: 1em;
			}

			p {
				line-height: 1.5;
				margin: 0.25em 0;
			}

			#controller-list ul {
				list-style-position: inside;
			}

			#controller-list li {
				line-height: 1.3;
				list-style-position: inside;
				margin: 0.25em 0;
			}

			@media screen and (max-width: 480px) {
				#status {
					display: none;
				}

				#page-body {
					margin: 0 1em 1em;
				}

				#page-body h1 {
					margin-top: 0;
				}
			}
		</style>
	</head>
	<body>
		<a href="#page-body" class="skip"><g:message code="default.link.skip.label" default="Skip to content&hellip;"/></a>
		<div id="status" role="complementary">
			<h1>Application Status</h1>
			<ul>
				<g:if test="${loggedIn}">
					<li>Logged in as: ${loggedIn.firstName} ${loggedIn.lastName}</li>
					<li>My Labels: ${loggedIn.assignedLabelCount}</li>
					<li>My items: ${loggedIn.registeredItemCount}</li>
					<li><g:link controller="lost" action="listEvents" params="${[ids: lostItems.id]}">My lost incidents: ${lostItems.size()}</g:link></li>
				</g:if>
				<li>App version: <g:meta name="app.version"/></li>
			</ul>
		</div>
		<div id="page-body" role="main">
			<g:if test="${flash.message}">
				<div class="message" role="status">${flash.message}</div>
			</g:if>
			<h1>Welcome to Pijunn!</h1>
			<g:if test="${foundItems}">
				<div class="errors">
					<span style="font-size: 1.4em;"> Someone found something you lost!  Please click the item below to begin the return process.</span>
					<ul><g:each in="${foundItems}" var="item">
						<li><g:link controller="found" action="collectReward" params="[eventId: item.id]">${item.description}</g:link></li>
					</g:each></ul>
				</div>
			</g:if>
			<g:if test="${params.registered}">
				<p><span class="bold">Thank you for registering with Pijunn!</span>  You can feel secure knowing that all of your valuable items
					are protected once you label them.  Pijunn is always free!  You may start by generating and printing 
					your own labels, but we recommend that you purchase our tamper-proof labels <a href="/Shop">here</a>.</p>
				<p>Once you are ready to label your items, you will want to return and use the <a href="${createLink(uri: '/labeledItem')}">Register Tags</a> link above
					to tell us which items you have labeled so that each is fully protected.</p>
			</g:if>
			<p>Pijunn makes it easy</p>
			<p>All you have to do is register your valuables on our site – it is free, and it is forever.</p>
			<p>If you have the misfortune of losing something, you come to the site and report it. We help you retrace your steps, and issue an APB to everyone we can along your path since you last remember seeing your valuable.</p>
			<p>When someone finds it, they come to the site (or our hotline) and report it found. We make sure everything is cool, then we start the return process. The finder gets a return envelope, the owner gets their stuff, we issue a reward, and everybody’s happy!</p>

			<g:if test="${loggedIn}">
				<div id="controller-list" role="navigation">
					<h2>My labels:</h2>
					<ul>
						<g:each var="c" in="${loggedIn.assignedTags.sort { it.serialNumber } }">
							<li class="controller"><g:link controller="labeledItem">${c.item ? c.item.name : c.serialNumber}</g:link></li>
						</g:each>
					</ul>
				</div>
			</g:if>
		</div>
	</body>
</html>
